<template>
  <div>
    <el-dialog
      :visible="true"
      :title="title"
      class="add_case_dialog"
      width="80%"
      :before-close="callOf"
    >
      <el-table
        :data="list"
        :header-cell-style="{ background: 'dodgerblue', color: '#eeeeee' }"
        :fit="true"
        style="width: 100%"
      >
        <!-- <el-table-column property="id" label="ID" min-width="10%" align="center" /> -->
        <el-table-column
          property="project"
          label="项目"
          min-width="20%"
          align="center"
        />
        <el-table-column
          property="version"
          label="版本号"
          min-width="20%"
          align="center"
          class-name="remarkinfo"
          label-class-name="remark-header"
        />
        <!-- <el-table-column
          property="enddate"
          label="结束时间"
          sortable
          min-width="30%"
        /> -->
        <el-table-column label="结束时间" min-width="10%" align="center">
          <template slot-scope="{ row }">
            <span>{{ row.enddate | parseTime("{y}-{m}-{d}") }}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column
          property="onlinedate"
          label="上线时间"
          sortable
          min-width="30%"
        /> -->
        <el-table-column label="上线时间" min-width="10%" align="center">
          <template slot-scope="{ row }">
            <span>{{ row.onlinedate | parseTime("{y}-{m}-{d}") }}</span>
          </template>
        </el-table-column>
        <el-table-column label="项目问题" min-width="40%" align="center" class-name="remarkinfo" label-class-name="remark-header">
          <template slot-scope="{ row }">
            <!-- <div v-html="ToBreak(row.remark)" slot="content"></div>  -->
            <el-input
              v-model="row.pquest"
              type="textarea"
              :rows="4"
              placeholder="无"
            />
          </template>
        </el-table-column>
        <el-table-column label="备注" align="center" class-name="remarkinfo" label-class-name="remark-header" min-width="40%">
          <template slot-scope="{ row }">
            <!-- <div v-html="ToBreak(row.remark)" slot="content"></div> -->
            <el-input
              v-model="row.remark"
              type="textarea"
              :rows="4"
              placeholder="无"
            />
          </template>
        </el-table-column>
      </el-table>
    </el-dialog>
    <pagination v-show="total > 0" :total="total" :page.sync="listQuery.page_num" :limit.sync="listQuery.page_per" @pagination="getCollectQuestionList" />
  </div>
</template>
<script>
import { getCollectQuestion } from '@/api/quality'
import Pagination from '@/components/Pagination'
// import { addCaseLibrary, updataCaseLibrary } from '@/api/case'

export default {
  name: 'Task',
  components: {
    Pagination
  },
  props: {
    // dialogAdd: Object,
    sizeForms: {
      type: Object,
      required: true
    },
    // edit: Boolean,
    title: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      listQuery: {
        group_name: '',
        radio: '',
        page_num: 1,
        page_per: 10
      },
      list: [],
      total: 0
    }
  },
  mounted() {
    this.getCollectQuestionList()
  },
  methods: {
    getCollectQuestionList() {
      this.listQuery.group_name = this.sizeForms.group_name
      this.listQuery.radio = this.sizeForms.radio
      getCollectQuestion(this.listQuery).then((response) => {
        this.list = response.data.items
        this.total = response.data.total
      })
    },

    callOf() {
      this.$emit('closePop')
    }
  }
}
</script>
<style lang='scss'>
/*.add {
  width: 100%;
}*/
.remarkinfo .cell{
text-align: left;
}
.remark-header .cell{
  text-align: center;
}
</style>
